package com.ynet.middleground.user.conf;

import com.ifp.framework.TaskLeader;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CatFilterConfig {

    @Value("${spring.application.name}")
    private String center;

    @Value("${zookeeper.addr}")
    private String zookeeper;

    @Bean(initMethod = "init", destroyMethod = "destroy")
    public TaskLeader leaders() {
        TaskLeader taskLeader = new TaskLeader();
        taskLeader.setCenter(center);
        taskLeader.setZookeeper(zookeeper);
        return taskLeader;
    }
}